const cmd = require('node-cmd');
module.exports = function (app) {
    // API::执行EP打开文件
    app.get('/epopen', (req, res) => {
        const project = req.query.project;
        const path = req.query.path;
        let Eppath = __dirname.replace(/R20\.feathersjs-server\\.*/g, 'R20.feathersjs-server\\');
        let Rpath = __dirname.replace(/R20\.feathersjs-server.*/g, project);
        cmd.run(
            'start' +
            ' ' +
            Eppath + 'ide.editplus\\EditPlus.exe' +
            ' ' +
            Rpath + '\\src\\' + path
        );
        return res.end('尝试打开 ' + Rpath + '\\src\\' + path);
    });
};
